Data compression methods and systems

ABSTRACT

The present invention is directed to methods and systems for taking measurements relating to subterranean formations. The methods and systems effectively compress data and thus facilitate more efficient data transmission. The methods and systems are capable of automatically varying data compression rates during a measurement operation. The variable data compression capability facilitates reliable collection of measurement data at faster and/or constant logging speeds. The data compression methods and systems may be applied to any measurement operation relating to subterranean formations, including, but not limited to: acoustic wireline logging measurements, acoustic logging-while-drilling measurements, electromagnetic measurements, nuclear magnetic resonance measurements, and resistivity measurements.

RELATED APPLICATIONS

This claims priority of U.S. Provisional Patent Application Ser. No.60/558,974 filed 2 Apr. 2004.

FIELD OF THE INVENTION

The present invention relates generally to methods and systems forinvestigating subterranean formations. More particularly, this inventionis directed to methods and systems for compressing data such assubterranean formation data.

BACKGROUND OF THE INVENTION

The investigation of subterranean formations is a common occurrence inoil and gas exploration and production operations. Methods and tools forinvestigating subsurface formations have advanced considerably over theyears. There are many commercially available acoustic, nuclear,electromagnetic, and resistance tools that provide a variety ofinformation about formations adjacent to a borehole. For example, somerecent wireline sonic logging tools can achieve full formationcharacterization.

For sonic logging tools, one of the important improvements in formationevaluation has been the increase in the number receivers andtransmitters. Some current sonic logging tools have dozens of receiversor more, which are located both longitudinally and azimuthally around areceiver sonde. In addition, some sonic tools include multiple monopoleand dipole sources, each capable of firing pulses at differentfrequencies. These advances in hardware have proven important for abetter understanding of formations surrounding boreholes, especially forcomplex environments such as altered or anisotropic formations. Suchcomplex environments require the collection and transmission of verylarge amounts of data.

However, the tradeoff for better formation evaluation during recentyears is reduced logging speed. Transmitting large amounts of data oftenrequires a decrease in logging speed. Communication bandwidth islimited, especially in a subterranean measurement environment.Therefore, the limiting factor in many subterranean measurementoperations is the communication capability. Accordingly, in order tosend the large amounts of data generated by recent formation measurementsystems, slower measurement-taking speeds are required, and slowermeasurement-taking speeds result in longer operations and increased rigtime. Longer operations and increased rig time result in additionalexpenses. Consequently, there is a need for data compression methods andsystems to enable more efficient communication between subterraneanmeasurement tools and surface apparatus.

The present invention is directed to overcoming, or at least reducingthe effects of, one or more of the problems outlined above.

SUMMARY OF THE INVENTION

The present invention meets the above-described needs and others.Specifically, the present invention provides methods and systems fortaking measurements relating to subterranean formations, such as loggingsubterranean formations. The methods and systems, however, effectivelycompress data and thus facilitate more efficient data transmission. Themethods and systems are capable of automatically varying datacompression rates during a measurement operation. The variable datacompression capability described herein facilitates reliable collectionof measurement data at constant logging speeds. Further, the datacompression methods and systems of the present invention may be appliedto any measurement operation relating to subterranean formations,including, but not limited to: acoustic wireline logging measurements,acoustic logging-while-drilling measurements, electromagneticmeasurements, nuclear magnetic resonance measurements, and resistivitymeasurements.

Application of the principles of the present invention provides a methodof effectively compressing data. According to some aspects, theinvention provides a method of taking measurements relating to asubterranean formation, comprising automatically compressingmeasurements data at variable compression rates as the measurements aretaken. The compression rates may be varied depending on externalconstraints of a measurement process. For example, the externalconstraints may include logging speed, drilling speed, telemetrybandwidth, and data size per distance (depth) of borehole traversed. Thevariable compression rates may include a combination of losslesscompression and lossy compression.

According to some aspects, the lossless compression comprisescompressing the measurements by linear predictive coding, compressingthe measurements by differential coding, determining which of the linearpredictive and differential coding provides higher compression, andreporting only the higher compression measurements. The losslesscompression may also include segmenting the measurements into smallerblocks prior to the linear predictive coding or differential codingoperations. The segmenting may comprise applying fixed-length windows tothe measurements, segregating different components present in themeasurements, or other segmenting procedures. The different componentmay be segregated by detecting a first break of different componentspresent in a waveform.

According to some aspects, the lossy compression comprises quantization.The quantization may include calculating a quantization step thatmaximizes compression ratio while maintaining at least a predeterminedsignal-to-noise-compression-ratio.

According to some aspects, the variable compression rates comprise afirst range of compression rates for measurement signals having anamplitude within a first range, and a second range of compression ratesfor measurement signals having an amplitude within a second range.

The principles of the present invention also provide a method of takingmeasurements relating to a subterranean formation comprising applying analgorithm that automatically varies a data compression rate of themeasurements relating to a subterranean formation. The algorithm maycompress the measurements according to two or more data compressionmethods in parallel and report only data having the highest compressionrate achieved by the one of the two or more data compression methods.The measurements may comprise logging measurements and the algorithm mayautomatically determine the data compression rate sufficient to maintaina substantially constant logging rate. The data compression rate maycomprise a combination of lossless and lossy compression.

The principles of the present invention also provide a method of takingsubterranean measurements comprising determining an approximatetelemetry bandwidth, assigning a minimum acceptablesignal-to-compression-noise ratio, creating multiple modes of datacompression with a lossless lower mode and a lossy upper mode at extentsof the multiple levels, compressing measurements taken according to aninitial compression rate, comparing a signal-to-compression-noise ratioof the compressed measurements to the minimum acceptablesignal-to-compression-noise ratio, changing the compression mode to ahigher compression rate of no higher than the lossy upper mode extent ifthe signal-to-compression-noise ratio is above the minimum acceptablesignal-to-compression-noise ratio, and changing the compression mode toa lower compression rate of no lower than the lossless lower mode extentif the signal-to-compression-noise-ratio is below the minimum acceptablesignal-to-compression-noise ratio. Many of the method steps may berepeated multiple times. For example, each of the steps beginning withcompressing measurements may be repeated for each waveform in anacoustic logging operation. According to some aspects, the multiplemodes of data compression are quantized. According to some aspects, theinitial compression rate comprises the lossless lower mode.

The principles of the present invention also provide a method of takingmeasurements relating to a subterranean formation comprisingautomatically compressing measurement data at variable rates to providedata of at least a predetermined quality at a substantially constantlogging rate. The variable compression rates may comprise at least onelossless compression rate and at least one lossy compression rate. Theat least one lossless compression rate may be achieved by segmenting themeasurements into blocks, compressing the segmented blocks by linearpredictive coding, compressing the segmented blocks by differentialcoding, determining which of the linear predictive and differentialcoding provides higher compression, and reporting only the highercompression segmented blocks.

The principles of the present invention also provide a method of takingsubterranean measurements comprising evaluating incoming subterraneanmeasurement data, and automatically determining whether to compress thedata losslessly or in a lossy manner. The automatically determining maycomprise compressing the incoming subterranean measurement data at adefault compression rate, comparing a signal-to-compression-noise ratioof the compressed data to a predetermined minimumsignal-to-compression-noise ratio, changing the default compression rateto lossless if the signal-to-compression-noise ratio of the compresseddata is less than the predetermined minimum signal-to-compression-noiseratio, changing the default compression rate to lossy if thesignal-to-compression-noise ratio of the compressed data is greater thana sum of the predetermined minimum plus and a predetermined additionalfactor.

The principles of the present invention also provide a method of takingmeasurements comprising compressing measurement data with a linearpredictive coding function, compressing the measurement data with adifferential coding function, determining which of the linear predictivecoding and differential coding functions provides higher compression,and reporting only the higher compression data. The compressing of themeasurement data by the linear predictive coding and differential codingfunctions is preferably performed in parallel.

The principles of the present invention also provide a method ofmanipulating data comprising compressing the data in parallel bymultiple compression methods, comparing the compressed data, andreporting only the compressed data with the highest compression rate.

The principles of the present invention also provide a system for takingmeasurements relating to a subterranean formation comprising ameasurement tool, a computer in communication with the measurement tool,and a set of instructions executable by the computer that, whenexecuted, automatically compresses measurement data at variablecompression rates as the measurements are taken.

The principles of the present invention also provide a computer readablestorage device encoding a program of instructions including instructionsfor automatically compressing measurement data at variable compressionrates as the measurements are taken related to a subterranean formation.

Additional advantages and novel features of the invention will be setforth in the description which follows or may be learned by thoseskilled in the art through reading these materials or practicing theinvention. The advantages of the invention may be achieved through themeans recited in the attached claims.

BRIEF DESCRIPTION OF THE DRAWINGS

The accompanying drawings illustrate preferred embodiments of thepresent invention and are a part of the specification. Together with thefollowing description, the drawings demonstrate and explain theprinciples of the present invention.

FIG. 1 a measurement system according to one embodiment of the presentinvention.

FIG. 2 is a block diagram illustrating a coding and decoding scheme fordata compression of subterranean measurements according to oneembodiment of the present invention.

FIG. 3 illustrates Linear Predictive Coding prior to encoding accordingto one embodiment of the present invention.

FIG. 4 illustrates an automatic signal segmentation method based onsegregating different component signals according to one embodiment ofthe present invention.

FIG. 5 illustrates Differential Coding prior to encoding according toone embodiment of the present invention.

FIG. 6 is a block diagram of a multiple data compression scheme run inparallel according to one embodiment of the present invention.

FIG. 7 is a flowchart illustrating a lossless data compression methodthat may be used according to one embodiment of the present invention.

FIG. 8 is a flow chart illustrating a lossy data compression method thatmay be used according to one embodiment of the present invention.

FIG. 9 illustrates a raw monopole waveform, noise, and a decompressedversion of the monopole waveform following compression of the rawmonopole waveform according to one method of the present invention.

FIG. 10 illustrates a frequency spectrum of the raw signal, adecompressed signal, and noise shown in FIG. 9.

FIG. 11 is a chart illustrating the relationship between highercompression rates and signal-to-compression-noise ratio (orcompression-noise).

FIG. 12 is a flowchart illustrating a method of automatic compressionrate adjustment to obtain a logging speed set within a predeterminedrange according one embodiment of the present invention.

FIG. 13 illustrates an improvement to logging speed available byimplementing the variable compression rate methods of the presentinvention.

FIG. 14 is a block diagram illustrating an error detection schemeimplemented by a telemetry system of a measurement tool according to oneembodiment of the present invention.

FIG. 15 is a block diagram illustrating conversion of measurement datato standard DLIS files as opposed to compressed files according tomethods of the present invention.

Throughout the drawings, identical reference numbers designate similar,but not necessarily identical, elements.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

Illustrative embodiments and aspects of the invention are describedbelow. It will of course be appreciated that in the development of anysuch actual embodiment, numerous implementation-specific decisions mustbe made to achieve the developers' specific goals, such as compliancewith system-related and business-related constraints, that will varyfrom one implementation to another. Moreover, it will be appreciatedthat such a development effort might be complex and time-consuming, butwould nevertheless be a routine undertaking for those of ordinary skillin the art having the benefit of this disclosure.

The present invention contemplates automatic compression rate variationsfor data compression rate measurements relating to a subterraneanformation. As mentioned above, measurements data levels have becomesufficiently high in modern oilfield tools so as to become a limitingfactor in many measurement operations. For example, the logging speed ofsome wireline logging tools must be reduced or changed during thelogging operation in some instances to ensure that all of the data iscollected and transmitted uphole, prior to the present invention. Thepresent invention provides methods and systems for variably compressingmeasurements data to provide quality data without requiring adjustmentsto external measurement parameters such as logging speed, drillingspeed, telemetry bandwidth, data size per distance, etc. The methods andsystems may be particularly well suited to acoustic wellbore loggingwith a sonic logging tool. However, the methods and systems presentedherein are not so limited. For example, the methods and systems may beapplied to resistivity logs, nuclear magnetic resonance measurements,electromagnetic measurements, vertical seismic profiles, check-shotsurveys, or other applications such as logging while drilling (LWD),measurement while frilling (MWD), permanent monitoring, semi permanentmonitoring, fracture monitoring (including hydrofrac monitoring),temperature monitoring and pressure monitoring. In a broader sense, thetechniques described herein can also be applied to measurements relatingto subterranean hydrocarbon reservoirs such as surface seismicapplications on land, marine or in a transition zone. The methods andsystems described herein facilitate data compression for anymeasurements collected and/or transmitted relating to subterraneanformations.

As used throughout the specification and claims, the term “logging”means to record a measurement versus depth or time, or both, of one ormore physical quantities in or around a well and includes, but is notlimited to: acoustic logging, resistivity logging, vertical seismicprofiles, check-shot surveys, logging while drilling (LWD), measurementwhile drilling (MWD), permanent monitoring, semi permanent monitoring,fracture monitoring (including hydrofrac monitoring), temperaturemonitoring and pressure monitoring. “Automatic” means capable ofproducing a desired result without human intervention.“Signal-to-compression-noise ratio” refers to the strength of an entiredata measurement such as a waveform, including raw noise, versus adecompressed data measurement that may include distortions resultingfrom data compression. Signal-to-compression-noise ratio does not referto the underlying noise in a raw data signal. The words “including” and“having,” as used in the specification, including the claims, have thesame meaning as the word “comprising.” The word “acoustic” includes bothfrequencies of conventional sonic tools, as well as those used inseismic tools and applications. “Perceptually transparent” is a termoften used by skilled artisans to describe a successful lossy datacompression.

The methods and systems presented herein for variably compressingmeasurements include certain specific algorithms by way of example toteach the principles of the present invention. Moreover, for clarity,the methods and systems are described below primarily with reference tosonic waveform data. However, the principles described may be applied toother data types, including, but not limited to, the data typesassociated with the measurements listed above (resistivity, nuclear,etc.). In addition, the algorithms disclosed to accomplish the methodsclaimed may be replaced by others that will be known to those of skillin the art having the benefit of this disclosure. One algorithmpresented below is based on linear predictive (LP) coding, followed byone-pass Huffman coding of the residuals. However, because signalstatistics vary considerably, measurements such as sonic waveforms maybe divided into blocks of data and the prediction is adapted to thestatistics of each block. The block size selection is a trade-offbetween an increase in side information necessitated by small blocksizes and a loss of fidelity due to large block sizes. According to LPcoding, the data compression is completely reversible and lossless. If ahigher logging speed is required or a combination withbandwidth-consuming tools is needed, the same lossless algorithm iscombined with an adaptive quantization technique to achieve highercompression rates. This quantization is non-reversible or “lossy” andsome differences between the original and compressed data, calleddistortion or compression noise, occur. The distortion caused byquantization is evaluated below using objective metrics, such assignal-to-compression-noise ratio, and subjective metrics that comparethe effects on waveforms in the time and frequency domains. Thisanalysis is important for assessing any effects on the output obtainedfrom conventional sonic processing. Examples of actual data demonstratethe efficiency of the variable compression and its effects when thelossy compression option is also used.

This disclosure describes methods that may be used in designing andimplementing a compression scheme for use with many applications, forexample sonic waveforms recorded by a wireline logging tool. Thedisclosure includes an explanation of the method steps of preferredembodiments of the invention, they theory behind the new variablecompression methods and systems, including how the prediction may bedone prior to the encoding. Practical steps that may be taken forimplementing the methods in downhole software are also described below.Examples of some typical compression rates are also provided.

It is desirable to compress data in a lossless manner if possible suchthat decoded measurements are identical to original measurements.Referring initially to FIG. 1, according to one embodiment describedbelow, measurements related to a subterranean formation 100, such asacoustic waveforms, are recorded by a measurement system such as awireline sonic tool 102, and transmitted to an uphole computer orsurface acquisition system 104. A communication channel may comprise awireline cable 106 that connects wireline tools with the surfaceacquisition system 104. An encoder, for example a 16-bit ADC, convertseach waveform or other measurement into signed integer samples with asampling rate of 10 μs or 40 μs depending on the firing. In the decoder,the 16-bit samples transmitted through the cable may be used to generatewaveforms that are similar to the originally recorded ones.

In order to maintain a reasonable logging speed, the required datatransmission rate for subterranean measurement with this simpleanalog-to-digital conversion is too large for a wireline cable.Therefore, it is necessary to consider a data compression scheme priorto transmission. One compression method described below achieves asignificant reduction in data size by successful application of modelingand coding techniques. By incorporating compression methods with the A/Dconverter, a more efficient communication system as represented in FIG.2 is obtained. In order for a measurement tool to reduce the size of thedata to be transmitted by the cable, encoding is implemented in thedownhole software. Decoding functions are installed in the upholesoftware and its purpose is to convert a binary sequence back into anoriginal waveform or other measurement.

According to some aspects of the invention, measurements data iscompressed based on linear predictive coding (LPC or LP coding). Withlinear prediction, waveform modeling is achieved by building anautoregressive model (AR) of the waveform, i.e., a model that is basedon the previous samples. In order to clarify waveform modeling, some keyelements defined below:

-   A waveform y is a sequence of amplitudes {y_(t)}_(t=1, . . . N),    where N is the length of the waveform.-   A predicted waveform ŷ is the sequence {ŷ_(t)}_(t=1, . . . N) where    each ŷ_(t) is a linear combination of p past samples.

$\begin{matrix}{{{\hat{y}}_{t} = {{\sum\limits_{i = 1}^{p}{a_{i}y_{t - i}\mspace{14mu}{for}\mspace{14mu} t}} = 1}},\ldots\mspace{11mu},N} & (1)\end{matrix}$

-   p is called prediction order, and the coefficients {a_(i)} are    called LP coefficients.-   e is defined as the sequence of the residuals {e_(t)}_(t=1, . . . N)    where    e _(t) =y _(t) −ŷ _(t) for t=1, . . . , N  (2)    Combining equations (1) and (2) yields:

$\begin{matrix}{{y_{t} = {{e_{t} + {\sum\limits_{i = 1}^{p}{a_{i}y_{t - i}\mspace{14mu}{for}\mspace{14mu} t}}} = 1}},\ldots\mspace{11mu},N} & (3)\end{matrix}$Which implies that raw signals can be uniquely defined using onlyresiduals and the LP coefficients. FIG. 3 represents the LPC compressionmethod, which may be done prior to encoding to yield better compressionresults. The expected gains are in the reduction of the variance and thedynamic range of the difference sequence. How much the variance isreduced depends on how well the predictor can estimate the next valuebased on the previous values.

One of the difficulties associated with linear prediction is finding theLP coefficients that minimize residual variance. According to somemethods of the present invention, this problem is presented below:

$\begin{matrix}{{{\sigma_{d}^{2} == {E\lbrack e_{t}^{2} \rbrack}} = {E\lbrack ( {y_{t} - {\sum\limits_{i = 1}^{p}{a_{i}y_{t - i}}}}\; )^{2} \rbrack}}\mspace{11mu}} & (4)\end{matrix}$where E[ ]is the expectation operator.The solution for equation (4) can be obtained by solving the followingset of equations:

$\begin{matrix}{{\frac{\partial\sigma_{d}^{2}}{\partial{ak}} = 0},\mspace{14mu}{{{for}\mspace{14mu} k} = 1},{\ldots\mspace{11mu} P}} & (5)\end{matrix}$Taking the derivative,

$\begin{matrix}{{\frac{\partial\sigma_{d}^{2}}{\partial a_{k}} = {{{- 2}{E\lbrack {( {y_{t} - {\sum\limits_{i = 1}^{p}{a_{i}y_{t}}}} )y_{t - k}}\; \rbrack}} = {{0\mspace{20mu}{for}\mspace{14mu} k} = 1}}},{\ldots\mspace{11mu} P}} & (6)\end{matrix}$and rewriting the expectations, yields:

$\begin{matrix}{{{\sum\limits_{i = 1}^{p}{a_{i}{R( {i - k} )}}} = {{{R(k)}\mspace{20mu}{for}\mspace{14mu} k} = 1}},{\ldots\mspace{11mu} P}} & (7)\end{matrix}$where R(k) is the autocorrelation function defined by:R(k)=E[y _(t) y _(t+k)] for k=1, . . . P  (8)For a given order, one way to solve the set of equations in (7) and (8)is to apply Durbin's algorithm, which computes the LP coefficients fromthe autocorrelation coefficients in an incremental manner. However,other algorithms may also be used.

According to some embodiments, measurement signals such as sonicwaveforms may be divided into blocks or segments prior to applying LPC.Dividing measurement signals into smaller blocks may be importantbecause most measurement signals considered are non-stationary. Hence,it is important to adapt the predictor to match the local statistics byusing blocking and adaptive prediction. The selection of the block sizeis a trade-off between an increase in side information necessitated bysmall block sizes and a loss of fidelity due to large block sizes. Theskilled artisan having the benefit of this disclosure may choose anappropriate block size according to conditions, preferences, or otherparameters. Although any data segmentation methods may be used, twopreferable methods are discussed below. The first data segmentationtechnique discussed below is a static or fixed-window size, and thesecond is a dynamic segmentation technique.

The more simple of the two data segmentation methods mentioned above isto choose a window of fixed length and apply the windows to an entiremeasurement signal. It will of course be appreciated, however, that afinal window or block may be of different size than the fixed length. Afixed-length segmenting method presents the benefit of minimal sideinformation related to the way the signal is segmented. The fixed lengthwindow blocking method may also be applied very quickly.

However, the static method described above may fail to yield acceptableresults when multiple component signals are present in a single block.Therefore, it may be preferable to isolate each component of the signal.Isolating each component generally results in better prediction, i.e.the residuals are smaller and thus easier to encode.

According to some aspects of the invention, segmenting the signalaccording to the different components present in the data isaccomplished by detecting the first break of the different components ofa waveform. By detecting first breaks of each different component, anoptimal window size is dynamically defined for each of the differentcomponents present in the measurement data. First breaks for eachdifferent component may be detected in any number of ways. For example,first breaks may be detected according to the methods and systemsdescribed in U.S. application Ser. No. 10/819,362 filed Apr. 6, 2004,which is hereby incorporated by this reference in its entirety. Afterdefining the window size, the LP coefficients and the residuals arecalculated as described above. FIG. 4 illustrates the segregation ofdifferent components contained in a seismic waveform.

Another data compression approach according to principles of the presentinvention may include identifying the first breaks of the differentcomponents of the measurement signal and compressing each separately.Considering one point of a signal, T, the time series before and afterthis point is modeled as an autoregressive model of order p. The signalcan be decomposed into two sub-series, where each one is expressed as anautoregressive model:

$\begin{matrix}\{ \begin{matrix}{{x_{t} = {{\sum\limits_{k = 1}^{p{(1)}}{a_{k}^{1}x_{t - k}}} + ɛ_{1,t}}},( {1 \leq t \leq T} )} \\{{x_{t} = {{\sum\limits_{k = 1}^{p{(2)}}{a_{k}^{2}x_{t - k}}} + ɛ_{2,t}}},( {T \leq t \leq N} )}\end{matrix}  & (9)\end{matrix}$The residuals, ε_(r,t), where r∈[1,2], are assumed to have adouble-sided exponential distribution, also called Laplacian pdf. ALaplacian distribution is defined as:

$\begin{matrix}{{p(x)} = {\frac{1}{\sqrt{2}\sigma}{\mathbb{e}}^{\frac{- \sqrt{2}}{\sigma}{x}}}} & (10)\end{matrix}$where |x| is the absolute value of x. Also, E(x)=0 and E(x²)=σ².Further, it is assumed that the residuals are uncorrelated with thedeterministic part of the original signal, i.e. E{ε_(r,t)x_(1−k)^(r)}=0.

The two AR models presented above (Equation (9)), a background noisemodel, and a signal model constitute a locally stationary AR model forthe estimation of the first break arrival. Assuming that the nondeterministic parts are Gaussian, the approximate likelihood function LFfor the two non deterministic time series in the interval [1,T] and[T+1, N] is expressed as:

$\begin{matrix}{{LF} = {( \frac{1}{\sqrt{2}\sigma_{1}} )^{\frac{T - 1 - {p{(1)}}}{2}}{\exp( {{- \frac{\sqrt{2}}{\sigma_{1}}}{\sum\limits_{t = {{p{(1)}} + 1}}^{T - 1}{ɛ_{1,t}}}} )} \times ( \frac{1}{\sqrt{2}\sigma_{2}} )^{\frac{N - T + 1}{2}}{\exp( {{- \frac{\sqrt{2}}{\sigma_{2}}}{\sum\limits_{t = T}^{N}{ɛ_{2,t}}}} )}}} & (11)\end{matrix}$With the log likelihood given by:

$\begin{matrix}{{\log({LF})} = {{{- \frac{T - 1 - {p(1)}}{2}}{\log( {\sqrt{2}\sigma_{1}} )}} - {\frac{\sqrt{2}}{\sigma_{1}}{\sum\limits_{t = {{p{(1)}} + 1}}^{T - 1}{ɛ_{1,t}}}} - {\frac{N - T + 1}{2}{\log( {\sqrt{2}\sigma_{2}} )}} - {\frac{\sqrt{2}}{\sigma_{2}}{\sum\limits_{t = T}^{N}{ɛ_{2,t}}}}}} & (12)\end{matrix}$

The solution of the maximum likelihood estimation of the modelparameters is obtained by differentiation of the log likelihood withrespect to the LP coefficients. The solution is:

$\begin{matrix}\{ \begin{matrix}{\sigma_{1,\max} = {\frac{1}{\sigma_{1}}{\sum\limits_{t = {{p{(1)}} + 1}}^{T - 1}{ɛ_{1,t}}}}} \\{\sigma_{2,\max} = {\frac{1}{\sigma_{2}}{\sum\limits_{t = T}^{N}{ɛ_{1,t}}}}}\end{matrix}  & (13)\end{matrix}$By substituting equation (13) into equation (12), the maximumlogarithmic likelihood function is reduced to:

$\begin{matrix}{{\log({LF})} = {{{- \frac{( {N - T + 1} )}{2}}{\log( \sigma_{2} )}} - {( {\frac{\log( \sqrt{2} )}{2} + \sqrt{2}} )( {N - {p(1)}} )} - {\frac{1}{2}( {T - {p(1)} - 1} ) \times {\log( \sigma_{1} )}}}} & (14)\end{matrix}$The model order is computed using the Bayesian information Criterion(BIC) defined as:BIC(p)=2* log [maximizedlikelihood]−2βlog Nwhere β represents the number of unspecified parameters of the model. Inthe case of two components, it is obtained asβ=p(1)+p(2)+4  (15)

The point T where the joint likelihood function is maximized, or whereBIC is minimized, determines the optimal separation of the twostationary time series, i.e., the first break. Therefore, it is possibleto express the log likelihood function as a function of the point ofseparation between the two time series. BIC criterion leads to thecomputation of:min[BIC(T)]=2×min(log(LF))−2(p(1)+p(2)+4)log N  (16)min[BIC(T)]=−min[(T−1−p(1))×logσ₁+(N−T+1)×logσ₂ +g(N)]  (17)

After the data is windowed, the optimal model order is computed usingthe BIC criterion. Knowing the model order, it is a simple matter tocompute the LP coefficients for each block and encode the residuals.According to this method, the encoding of the residuals is done block byblock. The different steps described above are done for each individualblock. This method provides the first break of the different componentspresent in a signal, along with the model order and related LPcoefficients for each. This information is directly used by the encoder,as explained below.

Using the method described above, not only is a good compression rateachieved, but also the first break and the different components of thedata are found. One application for the method described above is inLogging While Drilling (LWD), where the waveforms are recorded in adownhole memory, but the first break information can be sent upholeusing only few bits. The first break information can be also used tocalculate the velocity of the P and S waves excited by a monopole anddipole source S (FIG. 1) respectively. In wireline and seismicoperations, the first break information can be used to give an earlyestimation of the characteristics of the logged interval, and could beemployed to automatically “zone” the well, and generate smart parametersfor it.

Another compression method that may be employed according to aspects ofthe present invention is a Differential Pulse Code Modulation (DPCM)system. Using DPCM, instead of coding the amplitudes, the differencebetween consecutive values is coded. This concept may be extended to thep-th order, where the residual code is the error signal from the p-thorder difference. In other words, the residuals are calculated asfollows:e_(t) ⁰=y_(t)  (18)e _(t) ^(p+1) =e _(t) ^(p) −e _(t−1) ^(p) for p=0, . . . P and t=1, . .. N  (19)

Each residual term is formed from the difference of the previous orderpredictors. As each term involves only a few integeradditions/subtractions, it is possible to compute the residuals fordifferent orders, and estimate their variance. Hence, the order whichgives the smallest variance can be found. The process is summarized inFIG. 5. The predictor for differential coding is easily constructed atboth the sending and receiving devices. With differential coding, thereis no need to send the LP coefficients because the order is sufficientfor uniquely defining the prediction polynomial.

In order to retrieve the raw signal from the residuals, the predictedsignal must be calculated at the decoder. This is done for theappropriate order by using the following equation:ŷ _(t) ^(p+1) =y ₁ ^(p+1) −e _(t) ^(p+1) for p=0, . . . P and t=1, . . .N  (20)

These polynomials can be calculated simply in both the transmitter andreceiver. But, for practical reasons, and in order to simplify thecalculations as much as possible, it is assumed that they are calculateda priori or are hard-coded in. In conclusion, the transmitter calculatesthe residuals for all the possible orders, compares their variance inorder to find the best order, and sends it as side information as sideinformation. And because there is a one-to-one mapping between ordersand prediction polynomials, the signal can be generated without lossfrom the residuals. This near-zero overhead allows this method to givegood results, especially for short waveforms.

According to some aspects of the present invention, multiple methods ofcompression are applied to measurements data in parallel. Therefore, thebenefits and advantages of the general linear prediction anddifferential coding methods (and/or others) may be realized by combiningthem in an efficient manner. For both methods described above, low-orderprediction may be used in order to reduce complexity so that the methodscan be implemented within hardware constraints. The coefficients aretypically floats, and sending them without modification could causelarge overheads, especially in seismic measurement where the size of thewaveform (or, waveform portion) to be encoded is small. Therefore, aquantization scheme may be utilized such that each coefficient isuniquely associated with a small integer. According to one codingmethod, coefficients are multiplied by a factor then rounded to thenearest integer. In addition, rather than using 32 bits to representeach coefficient, only 7 to 10 bits may be used.

If multiple compression methods such as the two described above arecombined, according to some embodiments only the measurement with thehighest compression rate is reported and encoded. For example, theresults obtained from linear prediction may be compared with thoseobtained by differential coding. Tests on different waveforms have shownthat differential coding compression rates are sometimes higher thancompression rates associated with LPC compression. Also, tests haveshown that the performance of differential coding does not improvesignificantly with higher orders, therefore, according to some aspectsthe maximum order may be limited, for example, to p=6. However, higherorders may be used if desired.

Generally, the differential coding method yields good results when thewaveforms are relatively clean. On the other hand, linear predictiongenerally yields superior results for noisy data. By combining bothapproaches described above or others, most measurements can beeffectively compressed. An illustration of a method of combiningmultiple compression methods is presented in FIG. 6.

The use of linear prediction provides a substantial decrease in thevariance of the signal to be encoded. It also affects the distributionof the codes, and gives smaller entropy because of the steeperconcentration around 0. The samples in the prediction residuals areassumed to be uncorrelated and therefore may be coded independently. Thechallenge of residual coding is to find an appropriate form for theprobability density function (pdf) of the distribution of residualvalues so that they can be efficiently modeled.

According to some subterranean measurement systems, a variation of Eliascodes referred to as Golomb-Rice codes are used. The Golomb-Rice codesare preferred to other codes because they can be encoded and decodedwith a few logical operations. According to Golomb-Rice codes, eachinteger is divided into a sign bit and a positive amplitude value. Then,low order bits are written in binary form, and high order bits arewritten in unary form. The Golomb codes include a parameter g thatdecides the length of this boundary. Rice codes are a special case whereg=2^(m), where m is called the mantissa of the code. The primaryadvantage of Rice-Golomb codes is their simple one pass implementationthat does not rely on the construction of a large search tree, such asthat needed in a standard Huffman coding. This has significantimplications on the complexity of the whole process, and on thecomputational and storage overheads associated with transmitting a moregeneral code.

Using Golomb-Rice coding, the representation of any number n is theconcatenation of (n div 2^(m)) as a unary code and (n mod 2^(m)) isbinary. Thus, every integer n is represented by exactly |n/2^(m)|+m+1bits, where ┌_(x)┐ represents ceiling value of x. The mantissa value isa very important parameter that affects the efficiency of theGolomb-Rice codes. The length of the compressed sequence will be greatlyaffected if the wrong mantissa is chosen. In order to have an optimalrepresentation, it is necessary to find the mantissa m, such that halfthe samples lie in the range ±2^(m). This will ensure that theGolomb-Rice code is m+1 bits long with 0.5 probability and m+k+1 longwith 2^(−(m+k)) probability. Solving this problem for m gives:

$\begin{matrix}{m = {\log_{2}( {{\log(2)}*\frac{\sigma}{\sqrt{2}}} )}} & (21)\end{matrix}$Equation (21) implies that in order to calculate the best mantissa, m,the variance of the signal needs to be calculated, a step that can berelatively expensive in terms of computation time. By observing that:

$\begin{matrix}{{E( {x} )} = {{\int_{- \infty}^{+ \infty}{{x}{p(x)}\ {\mathbb{d}x}}} = \frac{\sigma}{\sqrt{2}}}} & (22)\end{matrix}$m can be directly estimated from the mean expectationm=log₂(log(2)*E(|x|))  (23)

Because the sum of absolute values is linearly related to the variance,m may be used as the basis for the selection predictor and the wholeprocess is relatively inexpensive to compute because it involves nomultiplications.

The complete prediction/coding process for lossless compressionincluding both the prediction process and the coding process explainedabove, is summarized in FIG. 7.

Rice-Golomb codes, like many similar coding methods, are optimized forpositive integer values. However, because the residuals can be alsonegative, a sign bit needs to be appended at the end of each code.Hence, the total size associated with these sign bits is exactly 1bit/sample. As described below, some aspects of the present inventionmay include a simple technique for increasing the compression rate byreducing the size of sign bits by 25 to 40%. The compression techniqueis based on a combination of Run Length Encoding (RLE) and Huffmancoding. Nevertheless, this additional compression method is optional,because the gain in size is related to the length of the waveforms, andit is a trade-off between the gains and the computing time.

The sign bit compression method comprises the following steps:

-   -   (1) First, a “magnitude+sign” depiction is used to represent        residuals. The magnitudes are compressed using the Rice-Golomb        algorithm explained above. The sign bits are grouped into one        single stream of bits, and they are coded as shown in the        following steps.    -   (2) The number of repeated bits is written as an integer. Run        Length Encoding is used to send the resulting sequence. For        example, if the sign bit sequence is 1110011110000, . . . the        result is (1,3),(0,2),(1,4),(0,4) . . .    -   (3) If the first sign bit (1 in the example above) is sent at        the beginning, then it is not necessary to send the encoded bit        (0 or 1) each time. So, the sequence above can become 1,3,2,4,4,        . . .    -   (4) Each number has at least one appearance. Therefore the        number to send can be decreased by 1. In the case of the example        above, it is only necessary to transmit the following sequence        1,2,1,3,3, . . .

(5) Huffman coding is applied to the resulting numbers and the Huffmancodebook is sent as side information. The results are good because smallnumbers usually repeat while large numbers are rare.

Quite often in subterranean measurement operations, compressed waveformsobtained with lossless methods (e.g. the LPC and differential codingmethods described above) are not sufficiently small. A loss in accuracyis sometimes an acceptable tradeoff in return for better compression.However, lossy algorithms are non-reversible and some difference betweenthe original and compressed/decompressed data occurs. This difference iscalled distortion or compression noise and may be quantified as asignal-to-compression-noise ratio. The paragraphs below present a methodof lossy compression of subterranean measurements, such as acousticwaveforms, based on a fixed-rate compression. Lossy compression methodsmay be combined with one or more of the lossless compression methodsdescribed above according to some aspects of the present invention,wherein the compression mode is automatically selected. The lossy methoddescribed below is an extension of the lossless method presented in theprevious section, with the addition of a scalar quantizer beforeencoding. That is to say, the main compression engine is still lossless,and quantization is applied as a pre-process. As described below, thedifferences between original and compressed waveforms which are causedby this process do not affect the overall quality of the data. FIG. 8illustrates one example of where this quantization process may fit intothe complete process.

Quantization is one of the simplest forms of lossy compression. It isthe process of representing a large—possibly infinite—set of values witha much smaller set. If this quantization process is performed separatelyon each sample from a signal sequence, it is called scalar quantization.A familiar quantizer is the analog-to-digital (A/D) converter, where theinput is analog. The rate of the quantizer is the average number of bitsrequired to represent a single quantizer output. The difference betweenthe quantizer input and quantizer output is called quantization error orquantization noise. The mean squared quantization error (MSQE), denotedas σ_(q) ², is the average squared difference between the quantizerinput and output.

If there is no prior information about the distribution of the quantizerinput, a uniform distribution is assumed. Error is also uniformlydistributed over the interval

$\lbrack {{- \frac{\Delta}{2}},\frac{\Delta}{2}} \rbrack.$The MSQE is expressed as:

$\begin{matrix}{\sigma_{q}^{2} = \frac{\Delta^{2}}{12}} & (24)\end{matrix}$For simplicity of implementation, the quantization interval is taken asa power of 2. If Δ=2^(n) can be written where n=0,1, . . . equation (24)can be rewritten as:

$\begin{matrix}{{\sigma_{q}^{2} = {{\frac{2^{2n}}{12}\mspace{14mu}{for}\mspace{14mu} n} = 0}},1,\ldots} & (25)\end{matrix}$

For most acoustic signals, low amplitude signals are more sensitive tonoise than high amplitude signals. Low amplitude signals also occur themost frequently and are easiest to compress effectively. Therefore,according to some aspects of the invention, distortion of thelow-amplitude signals is reduced or minimized. Low-amplitudemeasurements may be reduced or minimized with non-uniform quantizerssuch as logarithmic quantizers or companders (compressor/expander).

According to the methods of minimizing low-amplitude measurementdistortion discussed below, coding is controlled to ensure that acertain signal-to-compression-noise ratio is not exceeded. The problemis presented as follows: finding the optimal quantization step, Δ=2^(k),which achieves the highest possible compression rate, while satisfying:SNR_(k)≧K,  (26)where K is a positive integer (typically in dB), and SNR_(n) is thesignal-to-compression-noise ratio caused by re-quantization to Δ=2^(k).Using equation (25), equation (26) is rewritten as:

$\begin{matrix}{{10\mspace{14mu}{\log_{10}( \frac{\sigma^{2}}{2^{2k}/12} )}} > K} & (27)\end{matrix}$The optimal solution, k, that solves equation (27) is:

$\begin{matrix}{{k = \lfloor {\frac{1}{2}{\log_{2}( \frac{12\sigma^{2}}{10^{\frac{K}{10}}} )}} \rfloor},} & (28)\end{matrix}$where └┘ represents the floor value of a real number.

Equation (28) shows the relationship between the quantization step,Δ=2^(k), and the signal variance. Because the signal is divided intodifferent blocks, the low-amplitude blocks (which have a smallervariance) will also have a relatively small quantization step.Therefore, a signal with low amplitude, such as a headwave, is notsignificantly affected by the quantization process. In many instances,especially for high values of K, the value of k obtained can be largerthan the value of the original signal. In such cases, no quantizationoccurs and the whole process is totally lossless. Otherwise,quantization is conducted using a uniform quantizer whose step is sentto a receiver as side information. After the re-quantization process,the prediction and encoding processes are conducted in the same orsubstantially the same way as for lossless compression described above.Accordingly, the lossy method described above advantageously shares mostof the code used for lossless compression.

The design of a quantizer for a measurement such as a specific acousticsignal depends on source output and sensitivity to noise. Accordingly,an example of lossy compression of a monopole waveform containing bothcompressional and shear arrivals is presented below. As an exemplarythreshold used for purposes of discussion, K=40 dB is selected. However,any predetermined threshold may be used (e.g. 30 dB, 40 dB, 50 dB 60 dB,etc.). In order to compare raw compressed waveforms, both are plotted inFIG. 9. Also, the difference between the two curves (compression-noise)is plotted below the waveforms. The frequency content of this noisecompared to the frequency spectrum of the measurement signal ispresented in FIG. 10.

FIG. 9 indicates that in a time-domain, the differences (noise) causedby lossy compression according to the methods described above are quitesmall in comparison with the original signal. FIG. 9 also shows that thedifferences are exclusively concentrated in the sections of the waveformthat have the largest amplitudes. FIG. 10 shows that distortions causedby compression do not affect measurement signal power and that anyeffects are concentrated at the higher frequencies where the signalstrength is reduced. This observation has been verified by extensivetests, some of which are discussed below, and were performed ondifferent waveforms analyzing compression noise characteristics usingvarious signal processing techniques (STC, TKO . . . ).

Most measurement systems include software applications to facilitateoperations. Therefore, implementation of the principles discussed aboveto downhole software is discussed below. As mentioned above, for manymeasurement systems such as well logging systems, the principlelimitation related to recording large amounts of data with a highlogging speed is the ratio of the telemetry rate versus data size. Therelationship between logging speed, telemetry rate and data size can bewritten as follows:

${{Logging}\mspace{14mu}{Speed}_{({{ft}\text{/}h})}} = {3600 \times \frac{{Telemetry}_{({bps})}}{{Total}\mspace{14mu}{Data}_{({{bits}\text{/}{ft}})}*( {1 - {CR}} )}}$where the compression rate is defined as:

$\begin{matrix}{{CR} = {( {1 - \frac{{Compressed}\mspace{14mu}{Size}}{{Original}\mspace{14mu}{Size}}} )*100\%}} & (29)\end{matrix}$

As telemetry bandwidth is a relative constant for most subterraneanmeasurement systems, the primary ways to increase the logging speed areto reduce the size of the recorded data and/or increase the compressionrate. According to some aspects of the present invention, bothapproaches are combined in order to achieve the maximum logging speedwhile maintaining the highest data quality. To reduce data size,according to some aspects of the present invention, logging tools mayinclude several configuration modes wherein data is not recorded fromall receivers, and/or where modal decomposition is used in order to sendonly particular modes by combining data from all active azimuthalsensors. Also, in order to achieve size gains before transmitting datato a telemetry system, according to some aspects software code isimplemented on a tool DSP (downhole digital signal processor).Compressed waveforms are sent uphole using an available telemetry systemand decompression will be implemented using an uphole portion of theacquisition system (e.g. a truck or offshore unit).

According to some embodiments of the present invention, generic datamanagement software comprising an algorithm supports both lossless andlossy implementation with one code. Moreover, several levels ofcompression modes are constructed and tailored for different firings.The code is programmed to switch between these modes automatically,simply by changing a few parameters that do not require userinvolvement. This adaptability is important for a tool that has severalfiring modes, each with its own characteristics and quality concerns.

According to some aspects of the present invention, if the compressionrate—and logging speed—achieved by lossless compression is notsufficient to meet demands, lossy compression is considered. Below is adescription of one of many methods that may be used and implemented onsubterranean tool software to automatically switch between multiplelevels of lossless and lossy data compression modes. First, several setsof parameters are created for implementation by the data managementsoftware. These sets of parameters include: Processing block size,Quantization step for original waveform, and Minimum acceptable compression-SNR.

The sets of parameters created are called compression levels. Level 0represents lossless compression and higher levels represent parametersof progressively higher compression rates. However, as the compressionrate increases, so does the distortion to the data.

Telemetry systems generally have a fixed bandwidth. Therefore, it isimportant to have an accurate estimate of the amount of the data thatwill be transmitted. Dynamically changing compression rates necessitatedynamic changes to the logging speed. Changing logging speed is verydifficult or impossible to achieve automatically with current loggingsystems because of human involvement (winchman). It is generallypreferred to maintain a substantially constant logging speed. Moreover,some communication systems are not well suited to implementingvariable-rate coding (compression) techniques, including losslessalgorithms, because of the risk associated with fluctuation of channelcommunication rate.

However, according to principles of the invention there are methodscapable of benefiting from the adaptability of data management softwareapplications such as the one proposed herein in order to achieve astable logging speed and, at the same time, improve the quality of themeasurements related to subterranean formations (e.g. compressedwaveforms). The methods described below require very little computerresources and are suitable for downhole implementation. According to oneaspect, upper and lower limits are assigned to a total logging speed,and a data compressor dynamically changes its parameters automaticallyto satisfy the upper and lower logging speed limits.

According to some embodiments, the methods of variable compression arebased on the creation of at least two and preferably several levels ofcompression, with the lossless mode (renamed 0^(th) level) and the lossymode (renamed M^(th) level) as its predetermined lower and upper limits,respectively. The M^(th) level is preferably validated beforemeasurement operations using appropriate distortion metrics, such thatan operator is satisfied that data quality at the M^(th) level is withinacceptable limits (i.e., the data has a signal-to-compression-noiseratio greater than or equal to a predetermined level (e.g. 25 dB, 30 dB,40 dB, 50 dB or others)). Analysis of a validation process is discussedbelow.

According to one method, levels between the 0^(th) and M^(th) levels arecreated, 1,2, . . . ,M−1, M, such that lower numbers indicate lowercompression rates and less distortion (0^(th) level is equivalent to aminimal compression rate and zero distortion). FIG. 11 illustrates therelationship between compression rate and distortion (orsignal-to-compression-noise ratio). According to the example of FIG. 11,M=3. All levels i, where i<M, have less distortion than the M^(th)level. The M^(th) level is the most aggressive (has the highestcompression rate and corresponds to the fastest measurement (e.g.logging) rate available), and has the smallestsignal-to-compression-noise ratio. The lossless level (i=0) indicates nodifference between raw and compressed data. When i=0, thesignal-to-compression-noise ratio is approximately 100 dB, but notinfinite due to the digitization/quantization of the measurement (suchas a waveform) in 16-bit samples, as explained in section above.

According to some aspects, the compression scheme of a first set ofmeasurement data begins using the 0^(th) or default level because itallows estimation of the maximum size of the compressed measurement.“Default” indicates an initial or immediately previous level. If thecompression rate obtained is less than the lower limit (i=0) or higherthan the upper limit (i=M), then the mode is increased or decreased,accordingly. This is done iteratively, for each measurement, by usingthe constraint that the compression level, i, is always bounded asfollows: 0≦i≦M. The changes to compression rate mode may also be basedon signal-to-compression-noise ratio such that asignal-to-compression-noise ratio associated with each compression rateis compared to a predetermined minimum signal-to-compression-noiseratio. The mode, i, may be changed from the previous or initial (i.e.default) rate to a lower rate if the signal-to-compression-noise ratioless than the predetermined minimum signal-to-compression-noise ratio.Similarly, the default rate may be increased if thesignal-to-compression-noise ratio is greater than a sum of the minimumsignal-to-compression-noise ratio and a predetermined additional factor(e.g. total of the minimum signal-to-compression-noise ratio andpredetermined additional factor is 100 dB).

Because there is no downhole time available for trial-and-erroroperation, this information will be applied starting from the next framein an iterative manner. A simplified flowchart of the automaticallyadjusting compression method is illustrated in FIG. 12. The result ofapplying this simple scheme to dipole data from actual field datarecorded by the Schlumberger's MSIP EXP tool using only threecompression levels is shown in FIG. 13. According to the example shownin FIG. 13, two firings are used: 1) a monopole encoded using losslessmode; and 2) a dipole compressed using the lossy mode. An upper leftcolumn 114 indicates logging speed, which is linearly correlated withthe compression rate. An upper right column 116 shows thesignal-to-compression-noise ratio associated with the use of lossycompression (for dipole only). According to the upper columns, whichrepresent a logging operation without use of the stabilization functionof FIG. 12, logging speed must be considerably reduced in the 100–250foot depth region in order to provide data having asignal-to-compression-noise ratio of at least 40 dB. However, inpractice logging speed cannot be quickly changed and compression ratedoes not change at all. Therefore, according to conventional practice,the entire logging operation would have to be run at the slowest speedproviding acceptable data for the entire well (approximately 1800 ft/hrin the upper left column 114).

Analyzing the lower curves in FIG. 13 shows that implementing thevariable compression rate and stabilization function (FIG. 12) describedabove results in a generally constant the logging speed versus depth(lower left column 118). FIG. 13 also illustrates an improvement insignal-to-compression-noise ratio for all frames (lower right column120), because the lossy mode used for FIG. 13 is considered the mostaggressive, and it is outperformed—in terms of distortion—by all othermodes. Actually, for many frames where the data is easily compressible,the lossless mode is used and no noise is added to the data (shown asdiscontinuities in the lower right column 120)).

The DSP in the some measurement tools such as the MSIP logging tool isfixed-point, which means that floating-point calculations withoutoverflows can be very expensive. Computational errors are most likely tobe generated when estimating the logarithms such as in equation (29).According to some aspects of the present invention, this problem may bereduced or eliminated by computing a table of all possible logarithmvalues at the beginning of the processing and using the table for allsubsequent calculations. After successful implementation on the DSPsoftware, subsequent tests revealed that there are no such errors on theDSP for both lossless and lossy compression.

Moreover, to further reduce errors and minimize overhead, a 16-bitchecksum may be used according to some aspects of the invention alongwith Cyclic Redundancy Codes (CRC). According to this scheme, eachcompressed sequence is accompanied by a numerical value based on the sumof all bytes. The receiver then checks to make sure the accompanyingnumerical value is consistent with the received data. If the countsmatch, it is assumed that the complete transmission was received. Ifnot, the message is seen as garbled and is discarded from futureprocessing. Checksum is chosen for error-correction because of its smalloverhead and ease of implementation. A simple diagram of the system withthis added capability is presented in FIG. 14. In order to evaluate theperformance of the methods described above on actual field data,in-depth tests were conducted. Representative results are presentedbelow. According to one test, 13 receiver stations with 4 azimuthalreceivers R (FIG. 1) per station were used. Therefore, there were atotal of 52 receivers for each firing. The tool used has one DSP perreceiver station, which is why the waveforms recorded at each depth areconcatenated into one single waveform. This waveform is compressed andthe resulting sequence is sent to the master DSP, which sends it uphole.

For the acquisition, the three most standard firings were usedsimultaneously:

-   -   1. P and S mode: monopole firing with a frequency band of 5 to        15 kHz.    -   2. Dipole mode with a frequency band of 0.3 kHz to 3 kHz.    -   3. Stoneley mode: uses a monopole firing with a frequency band        of 0.3 kHz to 3.5 kHz.        The compression rates when applying the methods described above        on all the waveforms are presented in Table 1.

Llossless compression was applied to P and S waveforms, and lossy coding(level 2) to Dipole and Stoneley waveforms. Typically, the compressionrate varies with depth according to the present invention

TABLE 1 Compression rate table. Lossless compression is used for nearand far monopoles. Compression mode Min. CR Max. CR Average CR NearMonopole Lossless 45% 54% 49% Far Monopole Lossless 54% 58% 56% DipoleLossy 80% 85% 83% Stoneley Lossy 79% 83% 81%By using this compression scheme, the logging speed is typicallyimproved by a factor of 3 to 4.

As presented in Table 1, applying principles of the present inventionresults in a significant decrease in the data size for both lossless andlossy compression modes. For example, the data size for dipole isreduced by more than 80%, attaining a compression ratio of 5. The highcompression rates in lossy compression may trigger questions about thequality of the data following compression and subsequent decompression.However, tests have shown that applying the principles described above,the distortion due to the lossy compression is perceptually transparent.

The effects of the compression noise were evaluated using standard sonicprocessing applied to both the raw and compressed data. Time-domain andfrequency-domain analyses show that the effects of lossy compression arenegligible in both the time and frequency domains. Similar results wereobtained for other data sets covering fast, slow, and very slowformations.

Because of the large number of transmitters and receivers on certainlogging tools, a large number of waveforms are recorded at each depth. ADLIS file generated by one tool run can be enormous, hence consuming avast amount of memory. It can also be a serious problem for datadelivery, especially if remote processing is considered and data has tobe sent through a communication channel with limited bandwidth. The DLISfiles from a logging tool are mainly sensor waveforms, so applyingcompression to them can reduce the file size considerably.

Therefore, using compression as described herein, the DLIS file size canbe compressed by up to approximately 75% without any loss to the data.Before explaining the compression method in detail, the form of the DLISfiles is described. According to the some logging tool architecture,waveform samples are encoded as 32-bit floating-point values. Thesenumbers are the product of 16-bit integers and a gain correction value(32-bit floating point number). Applying a lossless compression mode asdescribed above to the waveforms results in significantly highercompression rates. FIG. 15 shows the effects of this compression schemeon the data size.

Concerning channels other than waveforms, simple coding schemes such asdifferential coding or simple mapping may be used. For example, there isa gain value associated with each waveform. This gain value takesinitially 32 bits. However, because there are only 8 different modes,only 3 bits are needed to uniquely describe the gain values. Thistranslates into a compression rate of more than 90 percent for the gainchannel.

The application of principles described above provides an adaptivemethod for compressing sonic waveforms using time-domain modeling andefficient coding techniques. The efficiency and limited memory usage ofthe methods described are especially suitable for implementation indownhole software recorded on a computer readable storage device such asa disc, even for fixed-point DSP. The methods and systems facilitatehigh compression rates for a wide range of measurements related tosubterranean formations different characteristics.

The methods and systems described herein provide a lossless compressionoption that achieves good compression rates while being completelyreversible. The methods and systems also have several lossy modes thatcan achieve higher compression rates with a minimum amount ofdistortion. Extensive tests on numerous field data sets have proven thatthe compression rates achieved by variable compression significantlyimproves the measurement (e.g., logging) speed. Analysis also indicatesthat the effects of lossy compression are negligible in both the timeand frequency domains according to principles of the present invention.

The preferred embodiments were chosen and described in order to bestexplain the principles of the invention and its practical application.The preceding description is intended to enable others skilled in theart to best utilize the invention in various embodiments and withvarious modifications as are suited to the particular use contemplated.It is intended that the scope of the invention be defined by thefollowing claims.

1. A method of taking measurements relating to a subterranean formation,comprising automatically compressing measurements data at variablecompression rates as the measurements are taken, wherein the variablecompression rates comprise a combination of lossless compression andlossy compression.
 2. A method of taking measurements relating to asubterranean formation according to claim 1, wherein the compressionrates are varied depending on external constraints of a measurementprocess.
 3. A method of taking measurements relating to a subterraneanformation according to claim 2, wherein the external constraintscomprise one or more of logging speed, drilling speed, telemetrybandwidth, and data size per distance.
 4. A method of takingmeasurements relating to a subterranean formation according to claim 1,wherein the lossless compression comprises: compressing the measurementsby linear predictive coding; compressing the measurements bydifferential coding; determining which of the linear predictive anddifferential coding provides higher compression; reporting only thehigher compression measurements.
 5. A method of taking measurementsrelating to a subterranean formation according to claim 1, wherein thelossless compression comprises: segmenting the measurements into smallerblocks; compressing the segmented blocks by linear predictive coding;compressing the segmented blocks by differential coding; determiningwhich of the linear predictive and differential coding provides highercompression; reporting only the higher compression segmented blocks. 6.A method of taking measurements relating to a subterranean formationaccording to claim 5, wherein the segmenting comprises applyingfixed-length windows to the measurements.
 7. A method of takingmeasurements relating to a subterranean formation according to claim 5,wherein the segmenting comprises segregating different componentspresent in the measurements.
 8. A method of taking measurements relatingto a subterranean formation according to claim 7, wherein the differentcomponents are segregated by detecting a first break of differentcomponents present in a waveform.
 9. A method of taking measurementsrelating to a subterranean formation according to claim 1, wherein thelossy compression comprises quantization.
 10. A method of takingmeasurements relating to a subterranean formation according to claim 9,wherein the quantization comprises calculating a quantization step thatmaximizes compression ratio while maintaining at least a predeterminedsignal-to-compression-noise ratio.
 11. A method of taking measurementsrelating to a subterranean formation according to claim 1, wherein themeasurements comprise logging measurements.
 12. A method of takingmeasurements relating to a subterranean formation according to claim 1,wherein the measurements comprise logging-while-drilling measurements.13. A method of taking measurements relating to a subterranean formationaccording to claim 1, wherein the measurements comprise electromagneticor resistivity measurements.
 14. A method of taking measurementsrelating to a subterranean formation, comprising automaticallycompressing measurements data at variable compression rates as themeasurements are taken, wherein the variable compression rates comprisea first range of compression rates for measurement signals having anamplitude within a first range, and a second range of compression ratesfor measurement signals having an amplitude within a second range.
 15. Amethod of taking measurements relating to a subterranean formationcomprising applying an algorithm that automatically varies a datacompression rate of the measurements relating to a subterraneanformation, wherein the algorithm compresses the measurements accordingto two or more data compression methods in parallel and reports onlydata having the highest compression rate.
 16. A method of takingmeasurements relating to a subterranean formation comprising applying analgorithm that automatically varies a data compression rate of themeasurements relating to a subterranean formation, wherein themeasurements comprise logging measurements and the algorithmautomatically determines the data compression rate necessary to maintaina substantially constant logging rate.
 17. A method of takingmeasurements relating to a subterranean formation comprising applying analgorithm that automatically varies a data compression rate of themeasurements relating to a subterranean formation, wherein the datacompression rate comprises a combination of lossless and lossycompression.
 18. A method of taking measurements relating to asubterranean formation according to claim 17, wherein the losslesscompression comprises: segmenting the measurements into blocks;compressing the segmented blocks by linear predictive coding;compressing the segmented blocks by differential coding; determiningwhich of the linear predictive and differential coding provides highercompression; reporting only the higher compression segmented blocks. 19.A method of taking measurements relating to a subterranean formationaccording to claim 15, wherein the measurements compriselogging-while-drilling measurements.
 20. A method of taking subterraneanmeasurements comprising: (a) determining an approximate telemetrybandwidth; (b) assigning a minimum acceptablesignal-to-compression-noise ratio; (c) creating multiple modes of datacompression with a lossless lower mode and a lossy upper mode at extentsof the multiple levels; (d) compressing measurements taken according toa default compression rate; (e) comparing a signal-to-compression-noiseratio of the compressed measurements to the minimum acceptablesignal-to-compression-noise ratio; (f) changing the compression mode toa higher compression rate of no higher than the lossy upper mode extentif the signal-to-compression-noise ratio is above the minimum acceptablesignal-to-compression-noise ratio; (g) changing the compression mode toa lower compression rate of no lower than the lossless lower mode extentif the signal-to-compression-noise ratio is below the minimum acceptablesignal-to-compression-noise ratio.
 21. A method of taking subterraneanmeasurements according to claim 20, further comprising: (h) repeatingsteps (d)–(g) multiple times.
 22. A method of taking subterraneanmeasurements according to claim 20 wherein the measurements comprisewaveforms, and further comprising repeating steps (d)–(g) for eachwaveform.
 23. A method of taking subterranean measurements according toclaim 20, wherein the multiple modes of data compression are quantized.24. A method of taking subterranean measurements according to claim 20wherein the default compression rate initially comprises the losslesslower mode.
 25. A method of taking subterranean measurements accordingto claim 20, wherein at least one of the multiple compression modescomprises: segmenting the measurements into blocks; compressing thesegmented blocks by linear predictive coding; compressing the segmentedblocks by differential coding; determining which of the linearpredictive and differential coding provides higher compression;reporting only the higher compression segmented blocks.
 26. A method oftaking subterranean measurements according to claim 20, wherein themeasurements comprise one or more of: logging measurements;logging-while-drilling measurements, electromagnetic measurements, andresistivity measurements.
 27. A method of taking measurements relatingto a subterranean formation comprising automatically compressingmeasurement data at variable rates to provide data of at least apredetermined quality at a substantially constant logging speed.
 28. Amethod of taking measurements relating to a subterranean formationaccording to claim 27, wherein the variable compression rates compriseat least one lossless compression rate and at least one lossycompression rate.
 29. A method of taking measurements relating to asubterranean formation according to claim 28, wherein the at least onelossless compression rate is achieved by: segmenting the measurementsinto blocks; compressing the segmented blocks by linear predictivecoding; compressing the segmented blocks by differential coding;determining which of the linear predictive and differential codingprovides higher compression; reporting only the higher compressionsegmented blocks.
 30. A method of taking subterranean measurementscomprising: evaluating incoming subterranean measurement data;automatically determining whether or not to compress the data losslesslyor lossly.
 31. A method of taking subterranean measurements according toclaim 30, wherein the automatically determining comprises: compressingthe incoming subterranean measurement data at a default compressionrate; comparing a signal-to-compression-noise ratio of the compresseddata to a predetermined minimum signal-to-compression-noise ratio;changing the default compression rate to lossless if thesignal-to-compression-noise ratio of the compressed data is less thanthe predetermined minimum signal-to-compression-noise ratio: changingthe default compression rate to lossy if the signal-to-compression-noiseratio of the compressed data is greater than a sum of the predeterminedminimum plus and a predetermined additional factor.
 32. A method oftaking measurements comprising: compressing measurement data with alinear predictive coding function; compressing the measurement data witha differential coding function; determining which of the linearpredictive coding and differential coding functions provides highercompression; reporting only the higher compression data.
 33. A methodcomprising taking measurements according to claim 32, wherein thecompressing of the measurement data by the linear predictive coding anddifferential coding functions is performed in parallel.
 34. A methodcomprising taking measurements according to claim 32, further comprisingsegmenting the measurements into blocks.
 35. A method comprising takingmeasurements according to claim 34, wherein the segmenting comprisesapplying fixed-length windows to the measurements.
 36. A methodcomprising taking measurements according to claim 34, wherein thesegmenting comprises segregating different components present in themeasurements.
 37. A method comprising taking measurements according toclaim 36, wherein the different components are segregated by detecting afirst break of different components present in a waveform.
 38. A methodmanipulating data comprising compressing the data in parallel bymultiple compression methods, comparing the compressed data, andreporting only the compressed data with the highest compression rate.39. A method of manipulating data according to claim 38, wherein thecompressing by multiple compression methods further comprises:compressing the data by linear predictive coding; and compressing thedata by differential coding.
 40. A method of manipulating data accordingto claim 39, further comprising segmenting the measurements into blocksprior to compressing.
 41. A system for taking measurements relating to asubterranean formation, comprising: a measurement tool; a computer incommunication with the measurement tool; a set of instructionsexecutable by the computer that, when executed, automatically compressesmeasurement data at variable compression rates as the measurements aretaken, wherein the variable compression rates comprise a combination oflossless compression and lossy compression.
 42. A system according toclaim 41 wherein the system is a logging system, alogging-while-drilling system, an electromagnetic measurement system, ora resistivity measurement system.
 43. A computer readable storage deviceencoding a program of instructions including instructions for:automatically compressing measurement data related to a subterraneanformation at variable compression rates as the measurements are taken,wherein the variable compression rates comprise a combination oflossless compression and lossy compression.